package com.ruoyi.garbage.service.impl;

import com.ruoyi.garbage.domain.ChallengeDetail;
import com.ruoyi.garbage.mapper.ChallengeDetailMapper;
import com.ruoyi.garbage.service.IChallengeDetailService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 挑战明细记录Service业务层处理
 *
 * @author 刘哲贤
 * @date 2023-01-07
 */
@Service
public class ChallengeDetailServiceImpl implements IChallengeDetailService {
    @Resource
    private ChallengeDetailMapper challengeDetailMapper;

    /**
     * 查询挑战明细记录
     *
     * @param id 挑战明细记录主键
     * @return 挑战明细记录
     */
    @Override
    public ChallengeDetail selectChallengeDetailById(Long id) {
        return challengeDetailMapper.selectChallengeDetailById(id);
    }

    /**
     * 查询挑战明细记录列表
     *
     * @param challengeDetail 挑战明细记录
     * @return 挑战明细记录
     */
    @Override
    public List<ChallengeDetail> selectChallengeDetailList(ChallengeDetail challengeDetail) {
        return challengeDetailMapper.selectChallengeDetailList(challengeDetail);
    }

    /**
     * 新增挑战明细记录
     *
     * @param challengeDetail 挑战明细记录
     * @return 结果
     */
    @Override
    public int insertChallengeDetail(ChallengeDetail challengeDetail) {
        return challengeDetailMapper.insertChallengeDetail(challengeDetail);
    }

    /**
     * 修改挑战明细记录
     *
     * @param challengeDetail 挑战明细记录
     * @return 结果
     */
    @Override
    public int updateChallengeDetail(ChallengeDetail challengeDetail) {
        return challengeDetailMapper.updateChallengeDetail(challengeDetail);
    }

    /**
     * 批量删除挑战明细记录
     *
     * @param ids 需要删除的挑战明细记录主键
     * @return 结果
     */
    @Override
    public int deleteChallengeDetailByIds(Long[] ids) {
        return challengeDetailMapper.deleteChallengeDetailByIds(ids);
    }

    /**
     * 删除挑战明细记录信息
     *
     * @param id 挑战明细记录主键
     * @return 结果
     */
    @Override
    public int deleteChallengeDetailById(Long id) {
        return challengeDetailMapper.deleteChallengeDetailById(id);
    }
}
